package com.gzq.factorymethod.exam07.simple;

import java.lang.reflect.InvocationTargetException;

import com.gzq.factorymethod.exam07.IHuman;

public class SimpleFactory {
	public static <T extends IHuman> T create(Class<T> c) {
		try {
			return c.getDeclaredConstructor().newInstance();
		} catch (NoSuchMethodException | SecurityException
				| InstantiationException | IllegalAccessException
				| IllegalArgumentException | InvocationTargetException e) {
			e.printStackTrace();
		}
		return null;
	}
}
